//
// Sewers (MP)
//

#include "stagesetup.h"

extern s32 intro[];
extern u32 props[];
extern struct path paths[];
extern struct ailist ailists[];

struct stagesetup setup = {
	NULL,
	NULL,
	NULL,
	intro,
	props,
	paths,
	ailists,
	NULL,
};

u32 props[] = {
	weapon(0x0100, 0x0000, PAD_MP10_0099, OBJFLAG_FALL, 0, 0, WEAPON_MPLOCATION00)
	ammocratemulti(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00A3, OBJFLAG_FALL, 0, 0, 1000)
	ammocratemulti(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00A4, OBJFLAG_FALL, 0, 0, 1000)
	weapon(0x0100, 0x0000, PAD_MP10_009A, OBJFLAG_FALL, 0, 0, WEAPON_MPLOCATION01)
	ammocratemulti(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00A5, OBJFLAG_FALL, 0, 0, 1000)
	ammocratemulti(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00A6, OBJFLAG_FALL, 0, 0, 1000)
	weapon(0x0100, 0x0000, PAD_MP10_009B, OBJFLAG_FALL, 0, 0, WEAPON_MPLOCATION02)
	ammocratemulti(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00A7, OBJFLAG_FALL, 0, 0, 1000)
	ammocratemulti(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00A8, OBJFLAG_FALL, 0, 0, 1000)
	weapon(0x0100, 0x0000, PAD_MP10_009C, OBJFLAG_FALL, 0, 0, WEAPON_MPLOCATION03)
	ammocratemulti(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00A9, OBJFLAG_00000008, 0, 0, 1000)
	ammocratemulti(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00AA, OBJFLAG_00000008, 0, 0, 1000)
	stdobject(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00B7, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	stdobject(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00B8, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	stdobject(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00B9, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	weapon(0x0100, 0x0000, PAD_MP10_009D, OBJFLAG_FALL, 0, 0, WEAPON_MPLOCATION04)
	ammocratemulti(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00AB, OBJFLAG_FALL, 0, 0, 1000)
	ammocratemulti(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00AC, OBJFLAG_FALL, 0, 0, 1000)
	weapon(0x0100, 0x0000, PAD_MP10_009E, OBJFLAG_FALL, 0, 0, WEAPON_MPLOCATION05)
	ammocratemulti(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00AD, OBJFLAG_FALL, 0, 0, 1000)
	ammocratemulti(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00AE, OBJFLAG_FALL, 0, 0, 1000)
	weapon(0x0100, 0x0000, PAD_MP10_009F, OBJFLAG_FALL, 0, 0, WEAPON_MPLOCATION06)
	ammocratemulti(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00AF, OBJFLAG_FALL, 0, 0, 1000)
	ammocratemulti(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00B0, OBJFLAG_FALL, 0, 0, 1000)
	weapon(0x0100, 0x0000, PAD_MP10_00A0, OBJFLAG_FALL, 0, 0, WEAPON_MPLOCATION07)
	ammocratemulti(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00B1, OBJFLAG_FALL, 0, 0, 1000)
	ammocratemulti(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00B2, OBJFLAG_FALL, 0, 0, 1000)
	weapon(0x0100, 0x0000, PAD_MP10_00A1, OBJFLAG_FALL, 0, 0, WEAPON_MPLOCATION08)
	ammocratemulti(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00B3, OBJFLAG_FALL, 0, 0, 1000)
	ammocratemulti(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00B4, OBJFLAG_FALL, 0, 0, 1000)
	weapon(0x0100, 0x0000, PAD_MP10_00A2, OBJFLAG_FALL, 0, 0, WEAPON_MPLOCATION09)
	ammocratemulti(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00B5, OBJFLAG_FALL, 0, 0, 1000)
	ammocratemulti(0x0100, MODEL_MULTI_AMMO_CRATE, PAD_MP10_00B6, OBJFLAG_FALL, 0, 0, 1000)
	tag(0x00, 1)
	// @bug: This lift is missing OBJFLAG_LIFT_CHECKCEILING. If one player stands
	// on top of another player while on this lift, they'll ascend indefinitely.
	lift(0x0100, MODEL_A51_LIFT_THINWALL, PAD_MP10_006A, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000, 0x006a, 0x006b, -1, -1, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001c71, 0x0074aaaa, 0x00000000)
	tag(0x01, 1)
	lift(0x0100, MODEL_A51_LIFT_THINWALL, PAD_MP10_006C, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE | OBJFLAG_LIFT_CHECKCEILING, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000, 0x006c, 0x006d, -1, -1, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001c71, 0x0074aaaa, 0x00000000)
	tag(0x02, 1)
	lift(0x0100, MODEL_A51_LIFT_THINWALL, PAD_MP10_006E, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE | OBJFLAG_LIFT_CHECKCEILING, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000, 0x006e, 0x006f, -1, -1, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001c71, 0x0074aaaa, 0x00000000)
	endprops
};

s32 intro[] = {
	spawn(PAD_MP10_008C)
	spawn(PAD_MP10_008D)
	spawn(PAD_MP10_008E)
	spawn(PAD_MP10_008F)
	spawn(PAD_MP10_0090)
	spawn(PAD_MP10_0091)
	spawn(PAD_MP10_0092)
	spawn(PAD_MP10_0093)
	spawn(PAD_MP10_0094)
	spawn(PAD_MP10_0095)
	spawn(PAD_MP10_0096)
	spawn(PAD_MP10_0097)
	spawn(PAD_MP10_0098)
	case(0, PAD_MP10_0070)
	case_respawn(0, PAD_MP10_0071)
	case_respawn(0, PAD_MP10_0072)
	case_respawn(0, PAD_MP10_0073)
	case_respawn(0, PAD_MP10_0074)
	case_respawn(0, PAD_MP10_0075)
	case_respawn(0, PAD_MP10_0076)
	case(1, PAD_MP10_0077)
	case_respawn(1, PAD_MP10_0078)
	case_respawn(1, PAD_MP10_0079)
	case_respawn(1, PAD_MP10_007A)
	case_respawn(1, PAD_MP10_007B)
	case_respawn(1, PAD_MP10_007C)
	case_respawn(1, PAD_MP10_007D)
	case(2, PAD_MP10_007E)
	case_respawn(2, PAD_MP10_007F)
	case_respawn(2, PAD_MP10_0080)
	case_respawn(2, PAD_MP10_0081)
	case_respawn(2, PAD_MP10_0082)
	case_respawn(2, PAD_MP10_0083)
	case_respawn(2, PAD_MP10_0084)
	case(3, PAD_MP10_008B)
	case_respawn(3, PAD_MP10_0085)
	case_respawn(3, PAD_MP10_0086)
	case_respawn(3, PAD_MP10_0087)
	case_respawn(3, PAD_MP10_0088)
	case_respawn(3, PAD_MP10_0089)
	case_respawn(3, PAD_MP10_008A)
	hill(PAD_MP10_005F)
	hill(PAD_MP10_002D)
	hill(PAD_MP10_003A)
	hill(PAD_MP10_002A)
	endintro
};

struct path paths[] = {
	{ NULL, 0, 0 },
};

u8 func1001_start_lifts[] = {
	activate_lift(1, 0x00)
	activate_lift(2, 0x01)
	activate_lift(3, 0x02)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1000_1680[] = {
	mp_init_simulants
	rebuild_teams
	rebuild_squadrons
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

struct ailist ailists[] = {
	{ func1000_1680,        0x1000 },
	{ func1001_start_lifts, 0x1001 },
	{ NULL, 0 },
};
